package com.easy.service.impl;

import com.easy.bean.Comment;
import com.easy.dao.CommentDao;
import com.easy.service.ICommentService;
import com.easy.util.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class CommentService implements ICommentService {
    @Autowired
    CommentDao commentDao;

    @Override
    public int addComment(Comment comment) {
        return commentDao.addComment(comment);
    }

    @Override
    public int editComment(Comment comment) {
        return commentDao.editComment(comment);
    }

    @Override
    public int deleteComment(int id) {
        return commentDao.deleteComment(id);
    }

    @Override
    public List<Comment> selectComment(Page page, String text) {
        return commentDao.selectComment(page,text);
    }


    @Override
    public Comment getCommentById(int id) {
        return commentDao.getCommentById(id);
    }

    @Override
    public int CommentCount(String text) {
        return commentDao.CommentCount(text);
    }

    @Override
    public List<Comment> getCommentByProid(int proid) {
        return commentDao.getCommentByProid(proid);
    }
}
